import scrapy

class Pailie3Spider(scrapy.Spider):
    name = "pailie3"
    allowed_domains = ["500.com"]
    start_urls = [
        "https://kaijiang.500.com/pls.shtml",  # 排列三页面
    ]

    def parse(self, response):
        # 提取排列三数据
        for row in response.css('table.tz tbody tr'):
            yield {
                'date': row.css('td::text').get(),  # 开奖日期
                'issue': row.css('td::text').get(),  # 期号
                'numbers': row.css('td.red::text').getall(),  # 开奖号码
            }